<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link rel="stylesheet" type="text/css" href="css/common.css"/>
    <script type="text/javascript" src="js/jquery.1.9.1.js" ></script>
    <script type="text/javascript" src="js/layer.js" ></script>
    <link rel="stylesheet" type="text/css" href="css/layer.css"/>
	<script type="text/javascript" src="js/mobileSelect.js"></script>
	<link rel="stylesheet" type="text/css" href="css/mobileSelect.css"/>
	<script type="text/javascript" src="js/rem.js" ></script>
	<script type="text/javascript" src="js/multiple-select.js?v=111"></script>
    <link rel="stylesheet" type="text/css" href="css/multiple-select.css"/>
    <title>人员信息</title>
</head>
<body>
	<ul class="order_money" style="padding: 0 0.3rem;background: #fff;">
		<li>
	    		<span class="fontchang">人员姓名</span>
	    		<div class="choose">
				<div>
					<img src="http://b-ssl.duitang.com/uploads/item/201704/10/20170410073535_HXVfJ.thumb.700_0.jpeg" />
					<img class="close" src="img/close.png" />
					<p>姓名</p>
					<input type="hidden" value="" id="name" />
				</div>
				<div>
					<img style="display: none;" src="img/addwl.png" />
				</div>
			</div>
	    </li>
		<li style="padding-bottom: 0;height: 1.1rem;position: relative;">
			<span class="type">职位信息</span><span class="jt" style="margin-top: 0.15rem;"></span>
			 <span class="bitian1">必填</span>
			 <select id="organId" name="organId" multiple="multiple" style="display: none;" >
		　　　　<option value="1">选项1</option>
		　　　　<option value="2">选项1</option>
		　　　　<option value="3">选项1</option>
		　　　　<option value="4">选项1</option>
		　　　　<option value="7">选项2</option>                                                                                                                                                           
		　　</select>   
			 
			<input type="hidden" name="" id="type" value="" />								
		</li>
	    <li>
	    		<span class="fontchang">分成百分比</span>
	    		<!--<span class="must">必填</span>-->
	    		<input type="number" name="" id="percent" value="" />
	    		<p class="percent_warn">注：此分成方式是用于会务、客服、财务分配比例。</p>
	    		<p class="percent_warn">周数据选择的百分比才计算此比例</p>
	    </li>
	    <li>
	    		<span class="fontchang">参会费</span>
	    		<!--<span class="must">必填</span>-->
	    		<input type="number" name="" id="fee" value="" />
	    </li>
	    <li>
	    		<span class="fontchang">备注</span>
	    		<textarea id="beizhu" value=""></textarea>
	    </li>
	</ul>
	<div class="preserve">保存</div>
</body>
<script>
$(function(){
	$("#organId").fSelect();
	$('.close').click(function(){
		$(this).parent().hide();
		$(this).parent().siblings().css('margin-left','0');
		$(this).parent().siblings().children().show();
	});
	//提交表单
	$('.preserve').click(function(){
		var name = $('#name').val();
		var job = $('#organId').val();
		var percent = $('#percent').val();
		var fee = $('#fee').val();
		var beizhu = $('#beizhu').val();
		if(name == ''||name == null){
			layer.open({
				content:'请填写人员姓名' ,
				skin: 'msg',
				time: 2 //2秒后自动关闭
			});
			return false;
		}
		if(job == ''||job == null){
				layer.open({
				content:'请选择职位' ,
				skin: 'msg',
				time: 2 //2秒后自动关闭
			});
			return false;
		}
		$.ajax({
		  type: 'post',
		  url:"" ,
		  data:{name:name,job:job,percent:percent,fee:fee,beizhu:beizhu},
		  dataType: "json",
		  success: function(data){
		    window.location.href = "index.html";
		  }
		});
	 });
	 //字体变化
	$('input').keyup(function(){
		if($(this).val() != ''){
			$(this).siblings('.must').hide();
			$(this).siblings('.fontchang').css('font-size','0.2rem');
		}else{
			$(this).siblings('.must').show();
			$(this).siblings('.fontchang').css('font-size','0.32rem');
		}
	});
	if($('#userid').val() != ''){
		$('#userid').parents('.choose').siblings('.fontchang').css('font-size','0.2rem');
	}else{
		$('#userid').parents('.choose').siblings('.fontchang').css('font-size','0.32rem');
	}
	$('.queding').click(function(){
		if($('#organId').val() != null){
			$('.type').css('font-size','0.2rem');
			$('.bitian1').hide();
		}else{
			$('.type').css('font-size','0.32rem');
			$('.bitian1').show();
		}
	});
	$('#clearAllBtn').click(function(){
		$('.type').css('font-size','0.32rem');
		$('.bitian1').show();
	});
	$('textarea').keyup(function(){
		if($(this).val() != ''){
			$(this).siblings('.must').hide();
			$(this).siblings('.fontchang').css('font-size','0.2rem');
		}else{
			$(this).siblings('.must').show();
			$(this).siblings('.fontchang').css('font-size','0.32rem');
		}
	});
});
</script>
</html>
